Shell Interface

 

Deadline: 24/2/2011 at 16:00 3/3/2011 at 16:00 (extended)

 

General Instructions:

 

This exercise will be carried out in teams of three. You have until Friday, February 4 to email Sotirios Terzis the group you are going to work in. Anybody that fails to do so will be allocated into a group by the teaching team.

 

The exercise consists of 6 parts, with each part having its own weight (see below). The above submission deadline is strict (i.e. no late submissions will be accepted).

 

For the submission of your exercise you should produce a single zip file that includes:

The zip file should be submitted using Spider.

 

For marking you will have to demonstrate your solution working in the lab to the lecturer or the postgraduate class demonstrators. Details about these demonstrations will follow in due time.

 

Exercise Description:

 

In this exercise you have to create a Java program that acts as a shell interface. The development of the program will be carried out in the following stages.

 

Part A

Simple Shell & Creating an External Process

These refer to the relevant sections of the Creating a Shell Interface Project.

 

Part B

Changing and Printing Directories

These refer to the Changing Directories section of the Creating a Shell Interface Project, with the addition of a built-in pwd and ls <path> commands, that print the current working directory and list the contents of the directory specified by the path, respectively.

 

Part C

Adding a History Feature

This refers to the relevant section of the Creating a Shell Interface Project.

 

Part D

Adding an alias/unalias command

For this part you must find out how the alias command on Unix shells operates and provide your implementation of it.

 

Part E

Adding command and file completion

For this part you must find out how command and file completion on Unix shells operates and provide your implementation using tab as the escape character.

Note that you must pick a directory with binaries as your system bin directory.

 

Part F

Any additional built-in feature of any of the Linux shells (e.g. recall of previous instruction parameters !$, etc.). For this part it recommended that you consult with the class lecturer about the feature you want to implement before implementation.

 

 

Marking Scheme:

 

Each of the above parts is marked as follows:

 

In all cases full marks will only be awarded in implementations that take pay particular attention to error handling, i.e. errors in the input provided by the user should not as far as possible crash the program, and to the provision of meaningful error messages to the user.